Skip to content

Conversation

@mimarec
Copy link

@mimarec mimarec commented Jul 8, 2021

This PR allows to follow the convention established by SEMVER for the version increment regardless of whether it is a stable version or not (equal or higher than 1.0.0).

In order to follow this convention the strict-semver property is added to the initial configuration.

const defaults = {
  infile: 'CHANGELOG.md',
  firstRelease: false,
  sign: false,
  noVerify: false,
  commitAll: false,
  silent: false,
  tagPrefix: 'v',
  scripts: {},
  skip: {},
  dryRun: false,
  strictSemver: false,
  gitTagFallback: true,
  preset: require.resolve('conventional-changelog-conventionalcommits')
}

By default this property will have value false to maintain the current behavior which is described in this section #347 #308 #310

The value of strict-semver is evaluated in the bump.js file to determine whether to strictly follow semver or to apply the current behavior.

if (typeof presetOptions === 'object') {
    if (semver.lt(currentVersion, '1.0.0') && !args.strictSemver) presetOptions.preMajor = true
}

You can set this property as follows:

  1. Set the strict-semver property to standard-version stanza in your package.json(assuming your project is JavaScript).
  2. Place the strict-semver property in a .versionrc, .versionrc.json or .versionrc.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant